<template>
  <view>
    <view class="search-container" :style="{'background-color':bgcolor}" @click="searchHandler">
      <view class="search-box" :style="{'border-radius':radius+'px'}">
        <uni-icons type="search" size="20"></uni-icons>
        <text class="placeholder">搜索</text>
      </view>
    </view>
  </view>
</template>

<script> 
  export default {
    name:"my-search",
    props:{
      bgcolor:{
        type:String,
        default:'#c00000'
      },
      radius:{
        type:Number,
        default:18
      }
    },
    data() {
      return {
        
      };
    },
    methods:{
      searchHandler(){
        uni.navigateTo({
          url:"/subpkg/search/search"
        })
      }
    }
  }
</script>

<style lang="scss">
.search-container{
  height: 50px;
  display: flex;
  align-items: center;
  // background-color: #c00000;
  .search-box{
    height: 36px;
    width: 90%;
    // border-radius: 18px;
    margin: 0 auto;
    background-color: #fff;
    line-height: 36px;
     text-align: center;
     color: gray;
    .placeholder{
     margin-left: 5px;
     margin-top: -2px;
     font-size: 17px;
    }
  }
}
</style>